<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>个人中心</title>
    <link rel="stylesheet" href="/home/css/reset.css">
    <link rel="stylesheet" href="/home/css/head-footer.css">
    <link rel="stylesheet" href="/home/css/user-center.css">
</head>

<body>
{include file='base/header' /}
<div class="user-center-wrap">
    <div class="user-center">
        <div class="bread-nav">
                <span>
                    <a href="javascript:void(0)">首页 ></a>
                </span>
            <span>
                    <a href="javascript:void(0)">用户中心</a>
                </span>
        </div>
        <div class="user-center-main clearfixa">
            {include file='base/menu' /}
            <div class="user-center-right fr">
                <form action="{:url('base/doUpdatepwd')}" method="post" class="form-left-space">
                    <div class="base-data-list data-list data-list data-list-show">
                        <!-- 所有页面右侧标题 -->
                        <p class="user-center-nav-title">
                            修改密码
                        </p>
                        <div class="form-top-space">
                            <label for="" class="information-nav-title">
                                当前密码：
                            </label>
                            <input type="password" class="second-inputbox" name="pwd" id="pwd">
                            <span id="pwdinfo"></span>
                        </div>
                        <div class="form-top-space">
                            <label for="" class="information-nav-title">
                                新密码：
                            </label>
                            <input type="password" class="second-inputbox" name="newpwd" id="newpwd">
                            <span id="newpwdinfo"></span>
                        </div>
                        <div class="form-top-space">
                            <label for="" class="information-nav-title">
                                确认密码：
                            </label>
                            <input type="password" class="second-inputbox" name="surepwd" id="surepwd">
                            <span id="surepwdinfo"></span>
                        </div>
                        <input type="submit" class="align-savebtn" value="保存">
                    </div>
                </form>
            </div>

        </div>
    </div>
</div>
{include file='base/footer' /}
</body>

</html>
<script src="/home/js/jquery-1.11.1.min.js"></script>
<script>
    $("#newpwd").on("blur", function () {
        var __this = $(this);
        var newpwd = $("#newpwd").val();
        if (newpwd == '') {
            $("#newpwdinfo").text('密码不能为空');
            __this.focus();
        }else{
            $("#newpwdinfo").text('');
        }
    })

    $("#surepwd").on("blur", function () {
        var __this = $(this);
        var newpwd = $("#newpwd").val();
        var surepwd = __this.val();
        if (newpwd != surepwd) {
            $("#surepwdinfo").text('两次输入的密码必须一样');
            __this.focus();
        }else{
            $("#surepwdinfo").text('');
        }
    })
</script>